#!/bin/csh -f

#**************************************************************************
#**
#**    Copyright (c) 1995-1997 by ABKGroup, UCLA VLSI CAD Laboratory,
#**    UCLA Computer Science Department, Los Angeles, CA 90095-1596 USA,
#**    and by the Regents of the University of California.
#**    All rights reserved.
#**
#**    No portion of this file may be used, copied, or transmitted for
#**    any purpose, including any research or commercial purpose,
#**    without the express written consent of Professor Andrew B. Kahng,
#**    UCLA Computer Science Department, 3713 Boelter Hall, Los Angeles,
#**    CA 90095-1596 USA.   Any copy made of this file must include this
#**    notice.    ABKGroup and the Regents of the University of California
#**    retain title to all copies of this file and/or its compiled
#**    derivatives.
#**
#**************************************************************************/


set DIFF=/usr/bin/diff
set WC=/usr/bin/wc
set PROG=RBPlaceTest
/bin/rm -f seeds.{in,out}

echo "------------  Running test 0a..." > new.out
echo -n Running test 0a...
${PROG}0.exe -f TESTS/primary1.nf.WS02.aux -saveAsNodes newprimary1 >>& new.out
cat newprimary1* >> new.out
rm newprimary1*
echo Ok

echo "------------  Running test 0b..." >> new.out
echo -n Running test 0b...
${PROG}0.exe -f TESTS/primary1.nf.WS10.aux -saveAsNodes newprimary1 >>& new.out
cat newprimary1* >> new.out
rm newprimary1*
echo Ok

echo "------------  Running test 0c..." >> new.out
echo -n Running test 0b...
${PROG}0.exe -f TESTS/saurabh1a.aux -saveAsNodes saur1a >>& new.out
cat saur1a* >> new.out
rm saur1a*
echo Ok

echo "------------  Running test 0d..." >> new.out
echo -n Running test 0c...
${PROG}0.exe -f TESTS/HP.aux -saveLEFDEF HP1 >>& new.out
cat HP1* >> new.out
rm HP1*
echo Ok

echo "------------  Running test 2 ..." >> new.out
echo -n Running test 2 ...
${PROG}2.exe -f TESTS/saurabh1-hg.aux -saveAs test9 -AR 1.0 >>new.out
cat test9.* >> new.out
rm test9.*
echo Ok


echo "------------  Running test 3 ..." >> new.out
echo -n Running test 3 ...
${PROG}3.exe -f TESTS/saurabh1.aux >>& new.out
echo Ok

 echo "------------  Running test 4a..." >> new.out
echo -n Running test 4a...
cp TESTS/seeds.in .
${PROG}4.exe -f TESTS/saurabh1.aux -plotWNames out >>& new.out
cat out.gpl >> new.out
rm out.gpl seeds.in
echo Ok

echo "------------  Running test 4b..." >> new.out
echo -n Running test 4b...
cp TESTS/seeds.in .
${PROG}4.exe -f TESTS/primary1.nf.WS02.aux -plotWNames out -legal >>& new.out
cat out.gpl >> new.out
rm out.gpl seeds.in
echo Ok

/bin/rm  *.gpl *.def >& /dev/null

egrep -v "(Created|sec|User|Platform|Memory us)" new.out > newout.notime
egrep -v "(Created|sec|User|Platform|Memory us)" expected.out > expectedout.notime
$DIFF newout.notime expectedout.notime > diffs.notime

echo " "
echo Differences from precomputed results
echo "  lines:  words:  bytes:    error log:"
$WC diffs.notime
